package com.zhuss.controller.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.product.site.CreateSiteBo;
import com.zhuss.bean.bo.product.site.DeleteSiteBo;
import com.zhuss.bean.bo.product.site.UpdateSiteBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.product.site.SiteOperateServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 站点操作的Controller
 * @author: zhushanshuo
 * @create: Wed Dec 30 08:43:41 CST 2020
 **/
@RestController
@RequestMapping("/site")
public class SiteOperateController extends BaseController {
	
	@Autowired
	@Qualifier("siteOperateService")
	private OperateService<Void, Object> siteOperateService;
	
	@Autowired
	@Qualifier("siteOperateServiceExt")
	private SiteOperateServiceExt siteOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateSiteBo bo) throws DzcxException {
		
		siteOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateSiteBo bo) throws DzcxException {
		
		siteOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteSiteBo bo) throws DzcxException {
		
		siteOperateService.delete(bo);
    }
	
}
